<?php
    $url = "http://testask.xcar.com.cn/q/1.html?tojson";
    $contents = file_get_contents($url);
    $data=json_decode($contents,true);
    $global=$data['global'];
    $scope=$data['scope'];
?>
<? echo '<script>window.pageDataG='.json_encode($global).'</script>'?>
<? echo '<script>window.pageData='.json_encode($scope).'</script>'?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="<?=$global['head']['keywords']?>" />
    <meta name="description" content="<?=$global['head']['description']?>" />
    <title><?=$global['head']['title']?></title>
<!--    <link rel="stylesheet" href="--><?//=$global['res_config']['css']?><!--">-->
    <? if(!empty($global['res_config']['css'])){?>
        <? foreach ($global['res_config']['css'] as $css){?>
            <link rel="stylesheet" href="<?=$css?>">
        <?}?>
    <?}?>
</head>
<body style="background: #f0f0f0;">
<? include "./common/header_tpl.php" ?>
<div class="question_wrap clearfix">
    <div class="fix_top clearfix" style="display: none;">
        <em class="qicon"></em>
        <div class="fix_top_title">
            <?=$scope['question_info']['subject'] ?>
        </div>
        <?if($scope['question_info']['is_collect']==0){?>
            <a href="javascript:" data-qid="<?=$scope['question_info']['qid'] ?>" class="collect">收藏问题</a>
        <?}else if ($scope['question_info']['is_collect']==1){?>
            <a href="javascript:" data-qid="<?=$scope['question_info']['qid'] ?>" class="collect collected">已收藏</a>
        <?}?>
        <div class="pre_info clearfix">
            <a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['question_info']['quid'] ?>" target="_blank" class="img"><img src="<?=$scope['question_info']['qicon'] ?>" width="34" height="34" alt=""></a>
            <a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['question_info']['quid'] ?>" target="_blank" class="name"><?=$scope['question_info']['qusername'] ?></a>
            <?if($scope['question_info']['is_follow']=1){?>
                <a href="javascript:void(0)" class="follow followed">已关注</a>
            <?}else if ($scope['question_info']['is_follow']=0){?>
                <a href="javascript:void(0)" class="follow">+关注</a>
            <?}else if($scope['question_info']['is_follow']=2){?>
                <a href="javascript:void(0)" class="follow followed">相互关注</a>
            <?}?>
        </div>
    </div>
    <div class="left_box margin_top">
        <div class="ask_box">
            <div class="ques_title">
                <i class="ask_box_icon"></i>
                <?if($scope['question_info']['is_collect']==0){?>
                    <a href="javascript:" data-qid="<?=$scope['question_info']['qid'] ?>" class="collect">收藏问题</a>
                <?}else if ($scope['question_info']['is_collect']==1){?>
                    <a href="javascript:" data-qid="<?=$scope['question_info']['qid'] ?>" class="collect collected">已收藏</a>
                <?}?>
            </div>
            <div class="ques_cont_title">
                <?=$scope['question_info']['subject'] ?>
            </div>
            <div class="ques_cont_per clearfix">
                <a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['question_info']['quid'] ?>" target="_blank" class="img"><img src="<?=$scope['question_info']['qicon'] ?>" width="34" height="34" alt=""></a>
                <a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['question_info']['quid'] ?>" target="_blank" class="name"><?=$scope['question_info']['qusername'] ?></a>
                <span><?=date('Y-m-d',$scope['question_info']['ctime']) ?></span>
                <span class="look">
                    <?if($scope['question_info']['views']!=0){?>
                        <i></i>
                        <em><?=$scope['question_info']['views']?></em>
                    <?}else{?>
                        <i style=" margin-top: 12px;"></i>
                        <em></em>
                    <?}?>
                </span>
            </div>
            <div class="ques_cont_des"><?=$scope['question_info']['content'] ?></div>
            <div class="tag_box">
                <? foreach($scope['question_info']['tags'] as $tag){?>
                    <span><?=$tag ?></span>
                <?}?>
            </div>
        </div>
        <div class="answer_box">
            <div class="ques_title">
                <i class="answer_box_icon"></i>
            </div>
            <div class="answer_list clearfix">
                <ul class="clearfix">
                    <? foreach($scope['answer_list'] as $itm){?>
                            <li class="clearfix detail_li">
                                <dl class="clearfix">
                                    <dt>
                                        <a href="http://my.xcar.com.cn/space.php?uid=<?=$itm['auid'] ?>" data-auid="<?=$itm['auid'] ?>" target="_blank" class="img"><img src="<?=$itm['aicon'] ?>" width="34" height="34"></a>
                                    </dt>
                                    <dd class="clearfix">
                                        <div class="clearfix">
                                            <div class="pre_head">
                                                <?if($itm['is_expert']==0){?>
                                                    <a href="http://my.xcar.com.cn/space.php?uid=<?=$itm['auid'] ?>"  data-auid="<?=$itm['auid']?>" style="height: 40px; line-height: 40px;" target="_blank" class="name"><?=$itm['ausername'] ?></a>
                                                <?}?>
                                                <?if($itm['is_expert']==1){?>
                                                    <a href="http://my.xcar.com.cn/space.php?uid=<?=$itm['auid'] ?>" data-auid="<?=$itm['auid']?>" target="_blank" class="name"><?=$itm['ausername'] ?></a>
                                                    <em></em>
                                                    <span class="hobby"><?=$itm['skill'] ?></span>
                                                <?}?>
                                            </div>
                                            <?if($itm['is_follow']==1){?>
                                                <a href="javascript:void(0)" class="follow followed">已关注</a>
                                            <?}else if ($itm['is_follow']==0){?>
                                                <a href="javascript:void(0)" class="follow">+关注</a>
                                            <?}else if($itm['is_follow']==2){?>
                                                <a href="javascript:void(0)" class="follow followed">相互关注</a>
                                            <?}?>
                                        </div>
                                        <div class="ques_cont_des">
                                            <?=$itm['content'] ?>
                                        </div>
                                        <div class="footnote">
                                            <span class="time"><?=date('Y-m-d',$itm['ctime'])?></span>
                                                <?if($itm['is_praises']==0){?>
                                                    <a href="javascript:void(0)" data-qid="<?=$scope['question_info']['qid']?>" data-aid="<?=$itm['aid']?>" data-auid="<?=$itm['auid']?>" class="like"><i class="icon"></i><i class="icon2"></i>
                                                        <?if($itm['praises']!=0){?>
                                                            <em><?=$itm['praises'] ?></em>
                                                        <?}else{?>
                                                            <em></em>
                                                        <?}?>
                                                    </a>
                                                <?}?>
                                                <?if($itm['is_praises']==1){?>
                                                    <a href="javascript:void(0)" data-qid="<?=$scope['question_info']['qid']?>" data-aid="<?=$itm['aid']?>" data-auid="<?=$itm['auid']?>" class="like liked"><i class="icon"></i><i class="icon2"></i><em><?=$itm['praises'] ?></em></a>
                                                <?}?>
                                        </div>
                                        <? foreach($itm['quote_list'] as $quote_list){?>
                                            <div class="inner_box">
                                            <a href="http://my.xcar.com.cn/space.php?uid=<?=$quote_list['auid'] ?>" target="_blank" class="img"><img src="<?=$quote_list['aicon'] ?>" width="34" height="34"></a>
                                            <div class="clearfix">
                                                <div class="pre_head">
                                                    <?if($quote_list['is_expert']==0){?>
                                                        <a href="http://my.xcar.com.cn/space.php?uid=<?=$quote_list['auid'] ?>"  style="height: 40px; line-height: 40px;" target="_blank" class="name"><?=$quote_list['ausername'] ?></a>
                                                    <?}?>
                                                    <?if($quote_list['is_expert']==1){?>
                                                        <a href="http://my.xcar.com.cn/space.php?uid=<?=$quote_list['auid'] ?>" target="_blank" class="name"><?=$quote_list['ausername'] ?></a>
                                                        <em></em>
                                                        <span class="hobby"><?=$quote_list['skill'] ?></span>
                                                    <?}?>
                                                </div>
                                            </div>
                                            <div class="ques_cont_des">
                                                <?=$quote_list['content'] ?>
                                            </div>
                                            <div class="footnote">
                                                <span class="time"><?=date('Y-m-d',$quote_list['ctime'])?></span>
                                                    <?if($quote_list['is_praises']==0){?>
                                                        <a href="javascript:void(0)" data-qid="<?=$scope['question_info']['qid']?>" data-aid="<?=$quote_list['aid']?>" data-auid="<?=$quote_list['auid']?>" class="like"><i class="icon"></i><i class="icon2"></i>
                                                            <?if($quote_list['praises']!=0){?>
                                                                <em><?=$quote_list['praises'] ?></em>
                                                            <?}else{?>
                                                                <em></em>
                                                            <?}?>
                                                        </a>
                                                    <?}?>
                                                    <?if($quote_list['is_praises']==1){?>
                                                        <a href="javascript:void(0)" data-qid="<?=$scope['question_info']['qid']?>?>" data-aid="<?=$quote_list['aid']?>" data-auid="<?=$quote_list['auid']?>" class="like liked"><i class="icon"></i><i class="icon2"></i><em><?=$quote_list['praises'] ?></em></a>
                                                    <?}?>
                                            </div>
                                        </div>
                                        <?}?>
                                    </dd>
                                </dl>
                                <? if ($itm['is_good']===1){?>
                                    <a href="javascript:void(0);"  data-qid="<?=$scope['question_info']['qid']?>" data-aid="<?=$itm['aid']?>" target="_blank" class="answer_btn active">最佳答案</a>
                                <?}else{?>
                                    <a href="javascript:void(0);" data-qid="<?=$scope['question_info']['qid']?>" data-aid="<?=$itm['aid']?>" target="_blank" class="answer_btn set_best">设为最佳</a>
                                <?}?>
                            </li>
                        <?}?>
                </ul>
            </div>
        </div>
        <?if($scope['question_info']['totalnum']>0){?>
            <div class="load-more">
                <a href="javascript:" class="load-btn" data-qid="<?=$scope['question_info']['qid']?>">加载更多<i class="more"></i></a>
            </div>
        <?}?>
    </div>
    <div class="right_box margin_top">
        <div class="user">
            <div class="img-wrap">
                <a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['user_info']['uid']?>" target="_blank">
                    <img onerror="javascript:this.src='http://image1.xcarimg.com/attachments/my/default/120.jpg'" src="<?=$scope['user_info']['icon']?>">
                    <?if($scope['user_info']['is_auth']==1){?>
                        <i class="xbb-bg v"></i>
                    <?}else{?>
                        <i class="xbb-bg v" style="display: none;"></i>
                    <? }?>
                </a>
            </div>
            <div class="name"><a href="http://my.xcar.com.cn/space.php?uid=<?=$scope['user_info']['uid']?>" target="_blank"><?=$scope['user_info']['username']?></a></div>
            <?if($scope['user_info']['is_follow']==1){?>
                <a href="javascript:void(0)" class="follow followed">已关注</a>
            <?}else if ($scope['user_info']['is_follow']==0){?>
                <a href="javascript:void(0)" class="follow">+关注</a>
            <?}else if($scope['user_info']['is_follow']==2){?>
                <a href="javascript:void(0)" class="follow followed">相互关注</a>
            <?}?>
            <div class="num">
                <div class="gz">
                    <a href="http://my.xcar.com.cn/friend/myfollow.php" class="clr" id="gzr" target="_blank">提问</a>
                    <span><?=$scope['user_info']['qnum']?></span>
                </div>
                <div class="bd"></div>
                <div class="fs">
                    <a href="http://my.xcar.com.cn/friend/myfans.php" class="clr" id="fsr" target="_blank">回答</a>
                    <span><?=$scope['user_info']['anum']?></span>
                </div>
            </div>
        </div>
        <div class="list">
            <div class="list_title">相关推荐</div>
            <ul class="recommend">
                <? foreach($scope['recommend_list'] as $itm){?>
                    <li class="clearfix"><a href="<?=$itm['link']?>" target="_blank" class="ellipsis_two"><?=$itm['title']?></a></li>
                <?}?>
            </ul>
        </div>
        <div class="list">
            <div class="list_title">最新回答</div>
            <ul class="recommend">
                <? foreach($scope['news_list'] as $itm){?>
                    <li class="clearfix"><a href="<?=$itm['link']?>" target="_blank" class="ellipsis_two"><?=$itm['title']?></a></li>
                <?}?>
            </ul>
        </div>
    </div>
</div>
<div id="graybg_pop" class="graybg_pop ie6fixed_t" style="display:none;"></div>
<div class="set_best_ans" style="display:none;">
    <div class="title">温馨提示<a href="javascript:void(0);" target="_blank" class="close"></a></div>
    <div class="note">
        <p>您确认要把该回复选为“最佳答案”吗？</p>
        <a href="javascript:void(0);" target="_blank" class="btn blue">确定</a>
        <a href="javascript:void(0);" target="_blank" class="btn gray">取消</a>
    </div>
</div>
<div class="cwy_share_float">
    <div id="partake_div" class="bdsharebuttonbox share-con bdshare-button-style0-32" data-bd-bind="1516688795888" data-tag="share_2">
        <a class="bds_weixin" title="分享到微信" data-cmd="weixin" href="javascript:void(0);"></a>
        <a class="bds_tsina" ttitle="分享到新浪微博" data-cmd="tsina"href="javascript:void(0);"></a>
        <a class="bds_qzone" title="分享到QQ空间" data-cmd="qzone" href="javascript:void(0);"></a>
        <a class="bds_sqq" title="分享到QQ好友" data-cmd="sqq" href="javascript:void(0);"></a>
    </div>
    <div class="goto_top"><a title="" href="#"><i class="icon"></i></a></div>
</div>
<div class="mark-bt"></div>
<div class="mark-btcon">
    <div class="bt-bg"></div>
    <a href="http://app.xcar.com.cn/#zoneclick=125837" class="join" target="_blank"></a>
    <a href="javascript:" class="close"></a>
</div>
<div class="cwy_attend_pop" style="display: none;">
    <span class="row_2">您确定取消关注？</span>
    <div class="btn_two">
        <form action="">
            <input type="button" class="btn_red" value="是">
            <input type="button" class="btn_gray" value="否">
        </form>
    </div>
</div>
<div class="cwy_attend_pop" style="display: none;">
    <span class="row_2">您确定取消收藏？</span>
    <div class="btn_two">
        <form action="">
            <input type="button" class="btn_red" value="是">
            <input type="button" class="btn_gray" value="否">
        </form>
    </div>
</div>
<? include "./common/footer_tpl.php" ?>
<script src="http://js.xcar.com.cn/tools/public_func.js"  charset="gbk"></script>
<script src="http://reg.xcar.com.cn/js/xlogin_box_new_youji.js"></script>
<script src="http://js.xcar.com.cn/login/msg.js" charset="gbk"></script>
<script src="http://js.xcar.com.cn/login/header2015.js?d=10270323" charset="gbk"></script>
<? if(!empty($global['res_config']['js'])){?>
    <? foreach ($global['res_config']['js'] as $js){?>
        <!--<script src="<?=$js?>"></script>-->
    <?}?>
<?}?>
<script src="//assertsdev.xcarimg.com:8080/dist/v1.0/js/detail.js"></script>
<script type="text/javascript" src="http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=20180123"></script>
<script>
    $("#xlogin").live("click",function(){
        $(".login").xLoginBox({
            func:function(){
                $("#xlogininfo").attr("style","");
                window.location.reload();
                callLoginScript.call(null);
                reloadMsgInfo.call(null);},
            args:[],
            show:true
        });});
</script>
</body>
</html>